<template>
  <div class="info">
    <h3>{{ newsdetail.title }}</h3>
    <p>
      <span
        >发表时间:{{
          newsdetail.add_time | dateformat("YYYY-MM-DD HH:mm:ss")
        }}</span
      >
      <span>点击:{{ newsdetail.click }}次</span>
    </p>
    <hr />
    <div class="content" v-html="newsdetail.content"></div>
  <comment :newsid="id"></comment>
  </div>
</template>
<script>
import { newsdetail } from "../../../static/api";
import  comment  from "../../components/comment";
export default {
  data() {
    return {
      newsdetail: [{}],
    };
  },

  methods: {},
  async created() {
    this.newsdetail = await newsdetail(this.id);
    console.log(this.newsdetail);
  },
  components: {
    comment,
  },
  props: ["id"],
};
</script>
<style lang="scss" scoped>
.info {
  text-align: left;
  padding: 2px 5px;
  margin-bottom: 50px;
  h3 {
    color: orangered;
  }
  p {
    display: flex;
    justify-content: space-between;
    color: #26a2ff;
  }
}
</style>
